package com.example.royalchef.base;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

;

/**
 * author: Administrator
 * created on: 2017/6/28 16:19
 * description:
 */

public class BaseRecyclerViewHolder extends RecyclerView.ViewHolder {

    private View convertView;

    private BaseRecyclerViewHolder(View itemView) {
        super(itemView);
        this.convertView = itemView;
    }

    public static BaseRecyclerViewHolder getHolder(Context context, int layoutId, ViewGroup parent) {
        View inflate = LayoutInflater.from(context).inflate(layoutId, parent, false);
        BaseRecyclerViewHolder holder = new BaseRecyclerViewHolder(inflate);
        return holder;
    }

    public View getView(int id) {
        return convertView.findViewById(id);
    }

    public View getItemView() {
        return convertView;
    }
}
